package com.example.springbootknife4j;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;

/**
 * 我还没有写描述
 *
 * @author <发哥讲Java-694204477@qq.com>
 * @version 1.0
 * @date 2021/5/27 23:25
 */
@Data
public class Result<T> implements Serializable {
    @ApiModelProperty(value = "响应码", name = "code")
    private String code;
    @ApiModelProperty(value = "响应消息", name = "msg")
    private String msg;
    @ApiModelProperty(value = "响应数据", name = "data")
    private T data;

    public static <T> Result<T> ok(T data) {
        Result<T> result = new Result<>();
        result.setCode("200");
        result.setMsg("success");
        result.setData(data);
        return result;
    }
}
